package com.chalk.service;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;

import com.chalk.model.Member;
import com.chalk.vo.MemberVo;
import com.chalk.vo.MyMemberVo;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * 会员表(Member)表服务接口
 *
 * @author maxiaoqiang
 * @since 2019-03-22 17:38:23
 */
public interface MemberService extends IService<Member> {

    /*自定义接口*/

    /**
     * 根据主键批量(逻辑)删除
     *
     * @param ids
     * @return
     */
    int deleteBatchByPrimaryKey(String[] ids);

    /**
     * 通过token获取当前用户
     *
     * @param request
     * @return
     */
    Member selectUserDetail(HttpServletRequest request);

    /**
     * 修改密码
     *
     * @param memberVo
     * @return
     */
    boolean updateMemberPwd(MemberVo memberVo);

    Member getMemberByMobilePhone(String mobilePhone);

    /**
     * 获取全部客户
     * @param myMemberVo
     * @return
     */
    Page<Member> getMyMembers(MyMemberVo myMemberVo,Member member);

    /**
     * 获取门店的会员列表
     * @param page
     * @param map
     * @return
     */
    Page<Member> getMembersByShopId(Page<Member> page, Map<String,Object>map);

    /**
     * 获取一级/二级分销商 客户id集合
     * @param member
     * @return
     */
    List<String> getMyMemberIds(Member member);


    /**
     * app获取会员基本信息
     * @param memberId
     * @return
     */
    Member getInfoByMemberId(String memberId);


    /**
     * 根据门店获取分销员  根据分销员获取区域商   根据区域商获取sellerId
     * @param member
     * @return
     */
    String getSellerId(Member member);

    /**
     * 根据用户账号获取门店账号
     * @param member
     * @return
     */
    Member getShopMember(Member member);

    /**
     * 小程序-更新积分
     * @param integral
     * @param type
     * @param memberId
     * @return
     */

    Boolean updateIntegral(Integer integral,String type,String memberId);




}